package com.codeforces;

import java.util.Scanner;

public class _304C {

	static Scanner scanner = new Scanner(System.in);
	static int n;
	
	public static void main(String[] args) {
		n = scanner.nextInt();
		if (n % 2 == 0) {
			System.out.println(-1);
		}
		else if (n == 1) {
			System.out.println("0\n0\n0");
		}
		else {
			for (int i=0;i<n;++i) {
				System.out.print(i);
				if (i < n - 1) {
					System.out.print(" ");
				}
				else System.out.println();
			}
			for (int i=2;;) {
				System.out.print(i);
				if (i != 1) {
					System.out.print(" ");
				}
				else {
					System.out.println();
					break;
				}
				i = (i+1) % n;
			}
			for (int i=2;;) {
				System.out.print(i);
				if (i != 0) {
					System.out.print(" ");
				}
				else {
					System.out.println();
					break;
				}
				i = (i+2) % n;
			}
		}
	}

}
